package com.ljk.util.pdf;

import com.itextpdf.text.DocumentException;
import com.ljk.util.pdf.data.MedicalRecordEntity;
import com.ljk.util.pdf.data.TcmPrescription;
import com.ljk.util.pdf.data.WesternPrescription;
import com.ljk.util.pdf.template.PdfTemplate4Bl;
import com.ljk.util.pdf.template.PdfTemplate4Xy;
import com.ljk.util.pdf.template.PdfTemplate4Zy;

import java.io.OutputStream;

public class PdfTemplateFactory {

    public static PdfTemplate4Bl createBlTemplate() {
        return new PdfTemplate4Bl();
    }

    public static PdfTemplate4Xy createXyPresTemplate() {
        return new PdfTemplate4Xy();
    }

    public static PdfTemplate4Zy createZyPresTemplate() {
        return new PdfTemplate4Zy();
    }

    public static void genBl(OutputStream os, MedicalRecordEntity bean) throws DocumentException {
        createBlTemplate().generatePdf(os, bean);
    }
    public static void genXyPres(OutputStream os, WesternPrescription bean) throws DocumentException {
        createXyPresTemplate().generatePdf(os, bean);
    }
    public static void genZyPres(OutputStream os, TcmPrescription bean) throws DocumentException {
        createZyPresTemplate().generatePdf(os, bean);
    }
}
